{{--@extends ('shop-backend::layout')--}}

{{--@section ('title','O2O设置')--}}

{{--@section('breadcrumbs')--}}
    {{--<h2>O2O设置</h2>--}}
    {{--<ol class="breadcrumb">--}}
        {{--<li><a href="{!!route('admin.store.index')!!}"><i class="fa fa-dashboard"></i> 首页</a></li>--}}
        {{--<li class="active"><a href="{{route('admin.promotion.suit.index')}}">导购设置</a></li>--}}

    {{--</ol>--}}
{{--@endsection--}}


{{--@section('content')--}}

    <div class="tabs-container">

        <ul class="nav nav-tabs">
            <li class="active"><a href="#tab_1" data-toggle="tab" aria-expanded="true">基础设置</a></li>
            {{--<li><a href="{{route('admin.shop.clerk.settings.agreement')}}">登陆协议设置</a></li>--}}
            <li ><a href="#tab_2" data-toggle="tab" aria-expanded="true">登陆协议设置</a></li>
        </ul>
        <form method="post" action="{{route('admin.setting.saveShopSetting')}}" class="form-horizontal"
              id="setting_site_form">
            {{csrf_field()}}
            <div class="tab-content">
                <div class="tab-pane active" id="tab_1">
                    <div class="panel-body">

                        <div class="form-group"><label class="col-sm-2 control-label">导购提成订单最低金额(元):</label>
                            <div class="col-sm-10"><input type="text" name="o2o_clerk_royalty_order_amount"
                                                          placeholder=""
                                                          class="form-control num"
                                                          value="{{settings('o2o_clerk_royalty_order_amount')}}"></div>
                        </div>


                        <div class="form-group"><label class="col-sm-2 control-label">导购提成（百分率）%:</label>
                            <div class="col-sm-10"><input type="text" name="o2o_clerk_royalty_ratio"
                                                          placeholder=""
                                                          class="form-control num"
                                                          value="{{settings('o2o_clerk_royalty_ratio')}}"></div>
                        </div>

                    </div>

                </div>
                <div class="tab-pane" id="tab_2">
                    <div class="panel-body">
                        <script id="container" name="o2o_clerk_login_agreement"
                                type="text/plain">
                            {!!settings('o2o_clerk_login_agreement ')!!}
                        </script>
                    </div>

                </div>
            </div>
            <div class="form-group" style=" margin-top: 15px">
                <div class="col-sm-4 col-sm-offset-2">
                    <button class="btn btn-primary" type="submit">保存设置</button>
                </div>
            </div>
        </form>
    </div>
{{--@endsection--}}

{{--@section('after-scripts-end')--}}
@include('UEditor::head')
    {!! Html::script(env("APP_URL").'/assets/backend/libs/jquery.form.min.js') !!}
    {!! Html::script(env("APP_URL").'/assets/backend/libs/webuploader-0.1.5/webuploader.js') !!}

    <script>

        $('.num').bind('input propertychange', function (e) {
            var value = $(e.target).val()
            if (!/^[-]?[0-9]*\.?[0-9]+(eE?[0-9]+)?$/.test(value)) {
                value = value.replace(/[^\d].*$/, '');
                $(e.target).val(value);
            }
        })


            $('#setting_site_form').ajaxForm({
                success: function (result) {
                    swal({
                        title: "保存成功！",
                        text: "",
                        type: "success"
                    }, function () {
                        location.reload();
                    });

                }
        })
    </script>
    <script type="text/javascript">
        var ue = UE.getEditor('container', {
            autoHeightEnabled: false,
            initialFrameHeight: 500
        });
        ue.ready(function () {
            ue.execCommand('serverparam', '_token', '{{ csrf_token() }}');//此处为支持laravel5 csrf ,根据实际情况修改,目的就是设置 _token 值.
        });
    </script>

{{--@endsection--}}










